import axios from 'axios';
axios.defaults.headers.post['data-Type'] = 'json';
axios.defaults.headers.post['Content-Type'] = 'application/json; charset=UTF-8';
let base = '/api';

export const requestLogin = params => { return axios.post(`${base}/login`, params).then(res => res.data); };

export const getUserList = params => { return axios.get(`${base}/user/list`, { params: params }); };

export const getUserListPage = params => { return axios.get(`${base}/user/listpage`, { params: params }); };

export const removeUser = params => { return axios.get(`${base}/user/remove`, { params: params }); };

export const batchRemoveUser = params => { return axios.get(`${base}/user/batchremove`, { params: params }); };

export const editUser = params => { return axios.get(`${base}/user/edit`, { params: params }); };

export const addUser = params => { return axios.get(`${base}/user/add`, { params: params }); };

export const getotherdata = params => {return axios.post(`${base}/itf/otherdata`, params).then(res => res.data);};

export const getItfList = params => {return axios.post(`${base}/itf/list`, params).then(res => res.data);};

export const getItfreturn = params => {return axios.post(`${base}/itf/returndata`, params).then(res => res.data);};

export const delinterface = params => {return axios.post(`${base}/itf/delitf`, params).then(res => res.data);};
export const modinterface = params => {return axios.post(`${base}/itf/moditf`, params).then(res => res.data);};
export const modvalue = params => {return axios.post(`${base}/itf/modvalue`, params).then(res => res.data);};

export const otheradd = params => {return axios.post(`${base}/itf/otheradd`, params).then(res => res.data);};
export const otherdel = params => {return axios.post(`${base}/itf/otherdel`, params).then(res => res.data);};
export const groupops = params => {return axios.post(`${base}/itf/groupops`, params).then(res => res.data);};

